home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 303 < prev    next >
Encoding:
Text File  |  1996-08-05  |  721 b   |  29 lines

  1. Path: wantree.com.au!usenet
  2. From: jpet@wantree.com.au (Jody Petroni)
  3. Newsgroups: comp.lang.c
  4. Subject: Loading a structure from a file
  5. Date: 4 Jan 1996 03:03:09 GMT
  6. Organization: Wantree Development
  7. Message-ID: <4cfg1d$5n9@vector.wantree.com.au>
  8. NNTP-Posting-Host: dialin44.wantree.com.au
  9. X-Newsreader: WinVN 0.92.6+
  10.  
  11. Im trying to load this large structure from a file=>
  12.  
  13. /*Existing Job Record*/
  14. struct jobrec{
  15.  int job;
  16.  char desc[81];
  17.  int amt[50];
  18.  };struct jobrec jobrecord[100];
  19.  
  20. rather than the following code=>
  21.  
  22. while(fscanf(fleptr,"%d%s%d%d%d...(50 times)",jobrecord[x].job,
  23.             jobrecord[x].desc,jobrecord[x].amt[y]..(50 times)..)!=EOF){
  24. /*... Other code here*/
  25. }
  26. Is there an easier way to do this
  27.  
  28. Please Help!!!
  29.